package com.flashshe.ds.linear
{
	import com.flashshe.ds.linear.AbstractLinear;
	import com.flashshe.error.MethodNotImplementError;
	
	
	public class AbstractStack extends AbstractLinear implements IStack
	{
		public function AbstractStack()
		{
			super();
		}
		
		public function push(v:Object):void
		{
			throw new MethodNotImplementError("add()");
		}									
		
		public function peek():Object
		{
			throw new MethodNotImplementError("getLast()");
		}
		
		
		public function pop():Object
		{
			throw new MethodNotImplementError("remove()");
		}	
		
		public override function add(v:Object):void
		{
			push(v);
		}									
		
		public override function getValue():Object
		{
			return peek();
		}
		
		
		public override function remove():Object
		{
			return pop();
		}	
	}
}